Skip to main content

Person API

Overview

The Person API enables partners to manage individual person entities within the system. This API provides comprehensive functionality for creating persons, retrieving person information with advanced filtering capabilities, and managing person-related documents. All operations support full KYC data structures including personal details, identification information, address details, PEP declarations, and compliance data.

Authentication

All Person API endpoints require authentication using API Key credentials.

Required Headers

x-app-id: YOUR_ORGANIZATION_ID
X-API-Key: YOUR_API_KEY

Both headers must be present in every request. Missing or invalid credentials will result in a 401 Unauthorized response.

Endpoints

Create Person

Creates a new person entity with full KYC information.

POST /api/persons

Request Headers

Content-Type: application/json
x-app-id: YOUR_ORGANIZATION_ID
X-API-Key: YOUR_API_KEY

Request Body

The request body accepts comprehensive person information organized into multiple sections.

Core Person Fields
FieldTypeRequiredDescription
firstNamestringYesFirst name of the person
middleNamestringNoMiddle name of the person
lastNamestringYesLast name of the person
fullNamestringNoFull name of the person
nationalitystringNoNationality of the person
dobstring (ISO 8601)NoDate of birth
emailstringNoEmail address
telephonestringNoPhone number
taxNumberstringNoTax identification number
birthPlacestringNoPlace of birth
Address Information
interface AddressDTO {
addressLine1?: string;
addressLine2?: string;
city?: string;
country?: string;
postCode?: string;
}
FieldTypeDescription
addressAddressDTOResidential address of the person
Identification Information
FieldTypeDescription
identificationTypestringType of identification document
identificationNumberstringIdentification document number
identificationIssueDatestring (ISO 8601)Date when identification was issued
identificationExpiryDatestring (ISO 8601)Date when identification expires
proofOfAddressTypestringType of proof of address document
Social Profiles
interface SocialProfileFieldsDTO {
socialMedia: string;
socialProfile: string;
}
FieldTypeDescription
socialProfilesSocialProfileFieldsDTO[]Array of social media profiles
Politically Exposed Person (PEP) Information
interface PepDetailDTO {
formerPosition?: string;
resignationDate?: string (ISO 8601);
pepPosition?: string;
appointmentDate?: string (ISO 8601);
relationship?: string;
}
FieldTypeDescription
politicallyExposedPersonstringPEP status declaration
pepDeclarationTypestringType of PEP declaration (notPep, formerPep, currentlyPep, familyMemberPep, closeAssociatePep)
pepDetailPepDetailDTODetailed PEP information if applicable
sanctionPersonstringSanction status
Financial Information
FieldTypeDescription
sourceOfWealthstringDescription of source of wealth
primarySourceIncomestring[]Array of primary income sources
primarySourceIncomeOtherstringOther income source if not in predefined list
isResidentOfUnitedStatesbooleanWhether person is a US resident
taxResidencystring[]Array of tax residency countries
Additional Declarations
FieldTypeDescription
experienceInBusinessstringDescription of business experience
relativeOrPublicPoststringInformation about relatives in public positions
isConvictedOfFelonybooleanWhether convicted of a felony
felonyConvictionDatestring (ISO 8601)Date of felony conviction if applicable
isInvolvedInLitigationbooleanWhether involved in litigation
litigationDetailsstringDetails of litigation if applicable

Request Example

{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"telephone": "+1234567890",
"nationality": "United States",
"dob": "1985-06-15",
"birthPlace": "New York",
"address": {
"addressLine1": "123 Main Street",
"addressLine2": "Apt 4B",
"city": "New York",
"country": "United States",
"postCode": "10001"
},
"identificationType": "Passport",
"identificationNumber": "P123456789",
"identificationIssueDate": "2020-01-15",
"identificationExpiryDate": "2030-01-15",
"proofOfAddressType": "Utility Bill",
"socialProfiles": [
{
"socialMedia": "LinkedIn",
"socialProfile": "john-doe"
}
],
"politicallyExposedPerson": "No",
"pepDeclarationType": "notPep",
"sanctionPerson": "No",
"sourceOfWealth": "Employment Income",
"primarySourceIncome": ["Employment", "Savings"],
"isResidentOfUnitedStates": true,
"taxResidency": ["United States"],
"experienceInBusiness": "10 years in financial services",
"relativeOrPublicPost": "No",
"isConvictedOfFelony": false,
"isInvolvedInLitigation": false,
"taxNumber": "123-45-6789"
}

Response

{
"statusCode": 201,
"data": {
"_id": "507f1f77bcf86cd799439011",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"telephone": "+1234567890",
"nationality": "United States",
"dob": "1985-06-15T00:00:00.000Z",
"birthPlace": "New York",
"address": {
"addressLine1": "123 Main Street",
"addressLine2": "Apt 4B",
"city": "New York",
"country": "United States",
"postCode": "10001"
},
"identificationType": "Passport",
"identificationNumber": "P123456789",
"identificationIssueDate": "2020-01-15T00:00:00.000Z",
"identificationExpiryDate": "2030-01-15T00:00:00.000Z",
"proofOfAddressType": "Utility Bill",
"socialProfiles": [
{
"socialMedia": "LinkedIn",
"socialProfile": "john-doe"
}
],
"politicallyExposedPerson": "No",
"pepDeclarationType": "notPep",
"sanctionPerson": "No",
"sourceOfWealth": "Employment Income",
"primarySourceIncome": ["Employment", "Savings"],
"isResidentOfUnitedStates": true,
"taxResidency": ["United States"],
"experienceInBusiness": "10 years in financial services",
"relativeOrPublicPost": "No",
"isConvictedOfFelony": false,
"isInvolvedInLitigation": false,
"taxNumber": "123-45-6789",
"percentageOfComplete": 75,
"createdAt": "2025-03-15T10:30:00.000Z",
"updatedAt": "2025-03-15T10:30:00.000Z"
}
}

Response Fields

FieldTypeDescription
statusCodenumberHTTP status code
dataPersonResponseDtoCreated person object with all submitted fields plus system-generated fields

Get Persons

Retrieves a paginated list of persons with advanced filtering and search capabilities.

GET /api/persons

Request Headers

x-app-id: YOUR_ORGANIZATION_ID
X-API-Key: YOUR_API_KEY

Query Parameters

ParameterTypeRequiredDescription
searchstringNoSearch term to filter persons by name, email, or identification number
nationalitystringNoFilter by nationality
identificationTypestringNoFilter by identification type
politicallyExposedPersonstringNoFilter by PEP status
sortBystringNoField to sort by: firstName, lastName, email, nationality, createdAt, updatedAt (default: createdAt)
sortOrderstringNoSort direction: asc or desc (default: desc)
pagenumberNoPage number for pagination (default: 1, minimum: 1)
limitnumberNoNumber of items per page (default: 10, minimum: 1, maximum: 100)

Request Example

GET /api/persons?search=john&nationality=United%20States&page=1&limit=20&sortBy=firstName&sortOrder=asc

Response

{
"statusCode": 200,
"data": {
"items": [
{
"_id": "507f1f77bcf86cd799439011",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"nationality": "United States",
"identificationType": "Passport",
"identificationNumber": "P123456789",
"politicallyExposedPerson": "No",
"percentageOfComplete": 75,
"createdAt": "2025-03-15T10:30:00.000Z",
"updatedAt": "2025-03-15T10:30:00.000Z"
}
],
"meta": {
"total": 1,
"page": 1,
"limit": 20,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
}
}

Response Structure

interface PersonsListResponseDto {
statusCode: number;
data: {
items: PersonResponseDto[];
meta: {
total: number;
page: number;
limit: number;
totalPages: number;
hasNextPage: boolean;
hasPreviousPage: boolean;
};
};
}
FieldTypeDescription
statusCodenumberHTTP status code
data.itemsPersonResponseDto[]Array of person objects matching the filters
data.meta.totalnumberTotal number of persons matching the query
data.meta.pagenumberCurrent page number
data.meta.limitnumberNumber of items per page
data.meta.totalPagesnumberTotal number of pages available
data.meta.hasNextPagebooleanWhether there is a next page
data.meta.hasPreviousPagebooleanWhether there is a previous page

Get Person by ID

Retrieves detailed information for a specific person.

GET /api/persons/{id}

Replace \{id\} with the actual person ID.

Request Headers

x-app-id: YOUR_ORGANIZATION_ID
X-API-Key: YOUR_API_KEY

Request Example

GET /api/persons/507f1f77bcf86cd799439011

Response

{
"statusCode": 200,
"data": {
"_id": "507f1f77bcf86cd799439011",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"fullName": "John Michael Doe",
"email": "john.doe@example.com",
"telephone": "+1234567890",
"nationality": "United States",
"dob": "1985-06-15T00:00:00.000Z",
"birthPlace": "New York",
"address": {
"addressLine1": "123 Main Street",
"addressLine2": "Apt 4B",
"city": "New York",
"country": "United States",
"postCode": "10001"
},
"identificationType": "Passport",
"identificationNumber": "P123456789",
"identificationIssueDate": "2020-01-15T00:00:00.000Z",
"identificationExpiryDate": "2030-01-15T00:00:00.000Z",
"proofOfAddressType": "Utility Bill",
"socialProfiles": [
{
"_id": "507f1f77bcf86cd799439012",
"socialMedia": "LinkedIn",
"socialProfile": "john-doe"
},
{
"_id": "507f1f77bcf86cd799439013",
"socialMedia": "Twitter",
"socialProfile": "johndoe"
}
],
"politicallyExposedPerson": "No",
"pepDeclarationType": "notPep",
"sanctionPerson": "No",
"sourceOfWealth": "Employment Income and Investments",
"primarySourceIncome": ["Employment", "Savings", "Investments"],
"primarySourceIncomeOther": null,
"isResidentOfUnitedStates": true,
"taxResidency": ["United States"],
"experienceInBusiness": "10 years in financial services industry",
"relativeOrPublicPost": "No",
"isConvictedOfFelony": false,
"felonyConvictionDate": null,
"isInvolvedInLitigation": false,
"litigationDetails": null,
"taxNumber": "123-45-6789",
"percentageOfComplete": 85,
"createdAt": "2025-03-15T10:30:00.000Z",
"updatedAt": "2025-03-15T11:45:00.000Z"
}
}

Response Structure

interface PersonResponseWrapperDto {
statusCode: number;
data: {
_id: string;
firstName: string;
middleName?: string;
lastName: string;
fullName?: string;
nationality?: string;
dob?: string;
email?: string;
telephone?: string;
taxNumber?: string;
taxResidency?: string[];
politicallyExposedPerson?: string;
pepDeclarationType?: string;
pepDetail?: {
formerPosition?: string;
resignationDate?: string;
pepPosition?: string;
appointmentDate?: string;
relationship?: string;
};
sanctionPerson?: string;
residentOfUnitedStates?: string;
socialProfiles?: Array<{
_id?: string;
socialMedia: string;
socialProfile: string;
}>;
experienceInBusiness?: string;
relativeOrPublicPost?: string;
address?: {
addressLine1?: string;
addressLine2?: string;
postCode?: string;
city?: string;
country?: string;
};
identificationType?: string;
identificationNumber?: string;
identificationIssueDate?: string;
identificationExpiryDate?: string;
proofOfAddressType?: string;
birthPlace?: string;
sourceOfWealth?: string;
primarySourceIncome?: string[];
primarySourceIncomeOther?: string;
isConvictedOfFelony?: boolean;
felonyConvictionDate?: string;
isInvolvedInLitigation?: boolean;
litigationDetails?: string;
isResidentOfUnitedStates?: boolean;
percentageOfComplete?: number;
createdAt: string;
updatedAt: string;
};
}

Get Person Documents

Retrieves all documents associated with a specific person, organized by document type.

GET /api/persons/{id}/documents

Replace \{id\} with the actual person ID.

Request Headers

x-app-id: YOUR_ORGANIZATION_ID
X-API-Key: YOUR_API_KEY

Request Example

GET /api/persons/507f1f77bcf86cd799439011/documents

Response

{
"statusCode": 200,
"data": {
"personId": "507f1f77bcf86cd799439011",
"personName": "John Doe",
"documents": [
{
"documentField": "identificationFile",
"folderName": "Identification Document",
"isApplicable": true,
"folder": {
"_id": "66a7600c78f68e2f3ec090b3",
"name": "Identification Document"
},
"documents": [
{
"_id": "66a7610f3e29e4d4a0b912b9",
"fileName": "passport.pdf",
"fileType": "application/pdf",
"fileSize": 1024000,
"bucket": "s3-bucket-name",
"bucketKey": "persons/507f1f77bcf86cd799439011/identification/passport.pdf",
"createdAt": "2025-03-15T10:35:00.000Z",
"updatedAt": "2025-03-15T10:35:00.000Z"
}
]
},
{
"documentField": "proofOfAddressFile",
"folderName": "Proof of Address",
"isApplicable": true,
"folder": {
"_id": "66a7600c78f68e2f3ec090b4",
"name": "Proof of Address"
},
"documents": [
{
"_id": "66a7610f3e29e4d4a0b912ba",
"fileName": "utility_bill.pdf",
"fileType": "application/pdf",
"fileSize": 512000,
"date": "2025-02-15",
"bucket": "s3-bucket-name",
"bucketKey": "persons/507f1f77bcf86cd799439011/address/utility_bill.pdf",
"createdAt": "2025-03-15T10:36:00.000Z",
"updatedAt": "2025-03-15T10:36:00.000Z"
}
]
},
{
"documentField": "cv",
"folderName": "CV",
"isApplicable": true,
"folder": {
"_id": "66a7600c78f68e2f3ec090b5",
"name": "CV"
},
"documents": [
{
"_id": "66a7610f3e29e4d4a0b912bb",
"fileName": "john_doe_cv.pdf",
"fileType": "application/pdf",
"fileSize": 256000,
"bucket": "s3-bucket-name",
"bucketKey": "persons/507f1f77bcf86cd799439011/cv/john_doe_cv.pdf",
"createdAt": "2025-03-15T10:37:00.000Z",
"updatedAt": "2025-03-15T10:37:00.000Z"
}
]
},
{
"documentField": "additionalDocuments",
"folderName": "Additional Documents",
"isApplicable": true,
"folder": {
"_id": "66a7600c78f68e2f3ec090b6",
"name": "Additional Documents"
},
"documents": [
{
"_id": "66a7610f3e29e4d4a0b912bc",
"fileName": "birth_certificate.pdf",
"fileType": "application/pdf",
"fileSize": 384000,
"bucket": "s3-bucket-name",
"bucketKey": "persons/507f1f77bcf86cd799439011/additional/birth_certificate.pdf",
"createdAt": "2025-03-15T10:38:00.000Z",
"updatedAt": "2025-03-15T10:38:00.000Z"
}
]
}
]
}
}

Response Structure

interface PersonDocumentsResponseDto {
statusCode: number;
data: {
personId: string;
personName: string;
documents: Array<{
documentField: string;
folderName: string;
isApplicable: boolean;
folder: {
_id: string;
name: string;
};
documents: Array<{
_id: string;
fileName: string;
fileType: string;
fileSize: number;
date?: string;
validity?: {
period?: string;
number?: number;
};
notice?: {
period?: string;
number?: number;
};
type?: string;
bucket: string;
bucketKey: string;
createdAt: string;
updatedAt: string;
}>;
}>;
};
}
FieldTypeDescription
statusCodenumberHTTP status code
data.personIdstringPerson ID
data.personNamestringFull name of the person
data.documentsArrayArray of document groups, each representing a document type
documentFieldstringInternal field identifier for the document type
folderNamestringHuman-readable label for the document type
isApplicablebooleanWhether this document type is applicable for the person
folderobjectFolder information where documents are stored
documentsArrayArray of files uploaded for this document type

Supported Document Types

The following document types are supported for persons:

  • Identification File (Passport, National ID, Driver's License)
  • Proof of Address File (Utility Bill, Bank Statement)
  • CV (Curriculum Vitae)
  • Additional Documents (Birth Certificate, Educational Certificates, etc.)

Enums and Constants

PEP Declaration Types

ValueDescription
notPepNot a Politically Exposed Person
formerPepFormer Politically Exposed Person
currentlyPepCurrently a Politically Exposed Person
familyMemberPepFamily member of a PEP
closeAssociatePepClose associate of a PEP

Sort By Fields

ValueDescription
firstNameSort by first name
lastNameSort by last name
emailSort by email address
nationalitySort by nationality
createdAtSort by creation date
updatedAtSort by last update date

Sort Order

ValueDescription
ascAscending order
descDescending order

Error Responses

401 Unauthorized

Returned when authentication credentials are missing or invalid.

{
"statusCode": 401,
"message": "Unauthorized",
"error": "Invalid API credentials"
}

404 Not Found

Returned when the requested person does not exist.

{
"statusCode": 404,
"message": "Person not found",
"error": "Not Found"
}

400 Bad Request

Returned when the request body contains invalid data.

{
"statusCode": 400,
"message": ["firstName must be a string", "firstName should not be empty", "lastName must be a string", "lastName should not be empty"],
"error": "Bad Request"
}

500 Internal Server Error

Returned when an unexpected error occurs on the server.

{
"statusCode": 500,
"message": "Internal server error",
"error": "Internal Server Error"
}

Data Validation Rules

Required Fields

The following fields are required when creating a person:

  • firstName
  • lastName

Conditional Validation

  1. Tax Residency

    • Cannot be provided if isResidentOfUnitedStates is null or undefined
    • Should not be provided if person is a US resident (isResidentOfUnitedStates is true)
  2. Felony Information

    • felonyConvictionDate is required only if isConvictedOfFelony is true
    • felonyConvictionDate should not be provided if isConvictedOfFelony is false
  3. Litigation Information

    • litigationDetails is required only if isInvolvedInLitigation is true
    • litigationDetails should not be provided if isInvolvedInLitigation is false
  4. PEP Information

    • pepDetail should be provided only if pepDeclarationType indicates PEP status
    • For formerPep: formerPosition and resignationDate are relevant
    • For currentlyPep: pepPosition and appointmentDate are relevant
    • For familyMemberPep or closeAssociatePep: relationship is relevant

Field Format

  • Dates: Must be in ISO 8601 format (YYYY-MM-DD or full ISO timestamp)
  • Email: Must be a valid email format
  • Arrays: Can contain multiple values for fields like primarySourceIncome, taxResidency, socialProfiles

Usage Notes

  1. All endpoints require valid API credentials in the request headers.
  2. Person creation validates that required fields (firstName, lastName) are provided.
  3. Dates should be provided in ISO 8601 format (YYYY-MM-DD or full ISO timestamp).
  4. Array fields accept multiple values where applicable.
  5. The search parameter in GET /api/persons searches across firstName, lastName, email, and identificationNumber fields (case-insensitive).
  6. Pagination is 1-indexed, with page 1 being the first page.
  7. Default sorting is by creation date in descending order (newest first).
  8. The limit parameter has a maximum value of 100 items per page.
  9. Document URLs are temporary and should be accessed within the validity period.
  10. The system automatically creates folder structures for document storage when a person is created.
  11. The percentageOfComplete field is automatically calculated based on filled fields and uploaded documents.
  12. Soft delete is implemented - deleted persons are excluded from queries automatically.
  13. All MongoDB ObjectIds are automatically serialized to strings in API responses.
  14. Tax residency and US resident fields have interdependent validation rules.
  15. PEP-related fields should be filled based on the pepDeclarationType value.